<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <style>
        .Odiv1{width: 80px;height: 80px;background: #aaa;margin: 5px;}
        .Odiv2{width: 50px;height: 50px;background: #ccc;}
    </style>
    </style>
    <div id="app">
        <div class="Odiv1" @click.self='doParent'>a
            <div class="Odiv2" @click='doThis'>b</div>
        </div>
        <div class="Odiv1" @click='doParent'>c
            <div class="Odiv2" @click='doThis'>d</div>
        </div>
    </div>
    <script>
        const app=new Vue({
            el:'#app',
            data:{},
            methods:{
                doParent(){
                    console.log("我是父元素单击的元素")
                },
                doThis(){
                    console.log("我是当前元素的单击事件")
                }
            }
        });
    </script>
</body>
</html>